package com.syt.cellphone.information.utils

import android.content.res.Resources
import android.util.TypedValue.COMPLEX_UNIT_DIP
import android.util.TypedValue.COMPLEX_UNIT_SP

/**
 *  @author: syt
 *  创建时间: 2020/8/11 15:19
 *  @功能   float 拓展
 *  @version v1.0
 */
val Float.dp: Float
    get() = android.util.TypedValue.applyDimension(
        COMPLEX_UNIT_DIP,
        this,
        Resources.getSystem().displayMetrics
    )

val Float.sp: Float
    get() = android.util.TypedValue.applyDimension(
        COMPLEX_UNIT_SP,
        this,
        Resources.getSystem().displayMetrics
    )